package com.wonderful.eyepetizer.data.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

/**
 * Desc:
 * @Author: wonderful
 * @Time: 2024/2/20 17:59
 */
@Dao
interface VideoDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun save(video: VideoEntity): Long

    @Query("select * from video where videoId=:videoId")
    suspend fun getVideo(videoId: Int): VideoEntity?

    @Query("select * from video")
    suspend fun getVideoList(): List<VideoEntity>

    @Delete
    suspend fun delete(video: VideoEntity): Int
}